UMBC High Performance Computing Facility : Running IDL on HPC Using the IDL Virtual Machine
This page last changed on Oct 24, 2008 by straha1.
Performing Calculations on the Cluster NodesWhen you run IDL on the cluster nodes, you are going to need to use the IDL Virtual Machine, not the normal IDL executable. The reason for this is that you need a license to run the normal IDL executable, but we have fewer licenses than compute nodes. The IDL Virtual machine cannot compile .pro files – you have to give it pre-compiled files. Thus we are going to create a IDL .sav file which will contain all of the functions that your program requires, all pre-compiled. Then we will use the IDL Virtual Machine on a cluster node to run the program. This tutorial will use the following IDL files. First, sayhello.pro: ; sayhello.pro pro sayhello,what print,'HELLO',what end and also, main.idl: pro main sayhello,'WORLD' end Step 1: Create Your IDL .sav FileIn order to create the IDL save file, you have to run the regular idl executable. IDL is installed on the head node hpc.rs.umbc.edu, so we'll run it there. Log in to hpc.rs.umbc.edu and cd to the directory that contains the sayhello.pro and main.idl files. Next you need to start idl. Unfortunately, the idl program is not in your path on hpc by default, so to start it you will need to type the full path to the program: /asl/opt/rsi/idl/bin/idl which should start IDL and give you the familiar "IDL>" prompt. Now we need to compile the top-level program main by running .compile main.pro: IDL> .compile main.pro % Compiled module: MAIN. IDL will need all of the procedures and functions that you need to run your program, not just the top-level one. We're going to use the resolve_all procedure to automatically compile all of the other routines that you need: IDL> resolve_all % Compiled module: RESOLVE_ALL. % Compiled module: SAYHELLO. % Compiled module: PATH_SEP. % Compiled module: UNIQ. The resolve_all command compiled the sayhello procedure for us, and also compiled resolve_all itself and all of resolve_all's prerequisites. If sayhello called a dozen other functions, resolve_all would have compiled those too. Now we need to save the compiled code into a .sav file: IDL> save,file='prog.sav',/routines The \/routines flag tells IDL to save all routines that have been compiled thus far into the prog.sav file. Note that you cannot put routines and variables in the same file. If you want to save variables as well, you will have to create a second .sav file. Let's check and make sure IDL added everything we needed to the prog.sav file. To do this, first quit IDL and start it again: IDL> exit username@hpc:~> /asl/opt/rsi/idl/bin/idl IDL> At the IDL> prompt, ask IDL to load prog.sav: IDL> restore,'prog.sav',/verbose % RESTORE: Portable (XDR) SAVE/RESTORE file. % RESTORE: Save file written by straha1@hpc.cl.rs.umbc.edu, Thu Oct 23 23:30:35 2008. % RESTORE: IDL version 7.0 (linux, x86_64). % RESTORE: Restored procedure: MAIN. % RESTORE: Restored procedure: RESOLVE_ALL. % RESTORE: Restored procedure: RESOLVE_ALL_CLASS. % RESTORE: Restored procedure: SAYHELLO. % RESTORE: Restored function: PATH_SEP. % RESTORE: Restored function: RESOLVE_ALL_BODY. % RESTORE: Restored function: UNIQ. The restore command loaded everything in the prog.sav file and listed everything that it was loading. Note that it has loaded our MAIN and SAYHELLO procedures, along with everything resolve_all needed. Now, let's test the main program just to make sure it works: IDL> main HELLOWORLD Apparently it does work, so quit IDL and go to the next section to learn how to run your program on the cluster.
Step 2: Run the IDL Virtual Machine on the Cluster NodesRunning IDL is much like running other serial jobs. We need to make a few simple modifications to the qsub scripts used elsewhere. We'll create sayhello.qsub which will contain: #!/bin/bash : The above line tells Linux to use the shell /bin/bash to execute : this script. That must be the first line in the script. : You must have no lines beginning with # before these : PBS lines other than the /bin/bash line: #PBS -N 'hello_parallel' #PBS -o 'qsub.out' #PBS -e 'qsub.err' #PBS -W umask=007 #PBS -q low_priority #PBS -l nodes=1:ppn=4 #PBS -m bea : Change the current working directory to the directory from which you ran qsub: cd $PBS_O_WORKDIR /asl/opt/rsi/idl/bin/idl -vt=prog.sav As always, submit the script using qsub: qsub sayhello.qsub Eventually your job should complete and produce qsub.out and qsub.err. The qsub.out file should contain "HELLO WORLD". It won't though. Instead, it will abort and tell you that it cannot find the X display. The reason is that the IDL Virtual Machine will not run your program until you click on a button on the IDL Virtual Machine splash screen. Since there is no X11 to display the splash screen on, and no user to click any button, the splash screen portion of the program aborts and your job does not run. |
Document generated by Confluence on Mar 31, 2011 15:37 |